import request from '@/utils/request'

// 通用请求
export default {

  get: (url, params)=> {
    return request({
      method: 'get',
      url,
      params,
    })
  },

  post: (url, data) => {
    return request({
      method: 'post',
      url,
      data
    })
  },

  put: (url, data) => {
    return request({
      method: 'put',
      url,
      data
    })
  },

  delete: (url, params) => {
    return request({
      method: 'delete',
      url,
      params
    })
  },

  // 下载
  download: (url, data) => {
    return request({
      method: 'post',
      url,
      data,
      responseType: 'blob'
    })
  }

}
